#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<queue>
#include<vector>
using namespace std;

#include"priority_queue.h"
#include"Date.h"
void test_priority_queue()
{
	//Sim::priority_queue<int> pq;
	Sim::priority_queue<int, vector<int>, greater<int>> pq;
	pq.push(1);
	pq.push(10);
	pq.push(2);
	pq.push(51);
	pq.push(4);
	while (!pq.empty())
	{
		cout << pq.top() << " ";
		pq.pop();
	}
	cout << endl;


	vector<int> v;
	v.push_back(15);
	v.push_back(20);
	v.push_back(100);
	v.push_back(1);
	v.push_back(3);
	Sim::priority_queue<int> p(v.begin(), v.end());
	while (!p.empty())
	{
		cout << p.top() << " ";
		p.pop();
	}
	cout << endl;


}

void Less()
{
	Sim::less<int> lessfunc;
	cout << lessfunc(1, 2) << endl;
}

void Date_test()
{
	//Sim::priority_queue<Date, vector<Date>, greater<Date>> pq;
	Sim::priority_queue<Date> pq;

	pq.push(Date(2023, 7, 1));
	pq.push(Date(2023, 7, 10));
	pq.push(Date(2023, 7, 12));
	pq.push(Date(2023, 7, 13));

	while (!pq.empty())
	{
		cout << pq.top();
		pq.pop();
	}
	cout << endl;
}

void Date_test1()
{
	//Sim::priority_queue<Date*, vector<Date*>,Sim::greater<Date*>> pq;
	Sim::priority_queue<Date*, vector<Date*>, Sim::less<Date*>> pq;

	//Sim::priority_queue<Date*, vector<Date*>, LessPDate> pq;
	//Sim::priority_queue<Date*> pq;

	pq.push(new Date(2023, 7, 1));
	pq.push(new Date(2023, 7, 10));
	pq.push(new Date(2023, 7, 12));
	pq.push(new Date(2023, 7, 13));

	while (!pq.empty())
	{
		cout << *(pq.top());
		pq.pop();
	}
	cout << endl;
}

int main()
{
	//test_priority_queue();
	//Less();
	Date_test1();
	return 0;
}
